package com.ruicar.afs.jobadmin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruicar.afs.jobadmin.core.model.AfsJobInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * The type AfsJobInfoMapper
 * <p>Description: </p>
 *
 * @author Fzero
 * @version 1.0
 * @date Created on 2020.06.13 14:17:12
 * @since 1.0
 */
@Mapper
public interface AfsJobInfoMapper extends BaseMapper<AfsJobInfo> {


    /**
     * Save int
     *
     * @param info info
     * @return the int
     */
    public int save(AfsJobInfo info);

    /**
     * Load by id afs job info
     *
     * @param id id
     * @return the afs job info
     */
    public AfsJobInfo loadById(@Param("id") int id);

    /**
     * Update int
     *
     * @param afsJobInfo afs job info
     * @return the int
     */
    public int update(AfsJobInfo afsJobInfo);

    /**
     * Delete int
     *
     * @param id id
     * @return the int
     */
    public int delete(@Param("id") long id);

    /**
     * Get jobs by group list
     *
     * @param jobGroup job group
     * @return the list
     */
    public List<AfsJobInfo> getJobsByGroup(@Param("jobGroup") int jobGroup);

    /**
     * Find all count int
     *
     * @return the int
     */
    public int findAllCount();

    /**
     * Schedule job query list
     *
     * @param maxNextTime max next time
     * @param pagesize    pagesize
     * @return the list
     */
    public List<AfsJobInfo> scheduleJobQuery(@Param("maxNextTime") long maxNextTime, @Param("pagesize") int pagesize);

    /**
     * Schedule update int
     *
     * @param afsJobInfo afs job info
     * @return the int
     */
    public int scheduleUpdate(AfsJobInfo afsJobInfo);


}
